import { FC, lazy } from "react";
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";

// import Login1 from '../pages/login/login1'
const Login1 = lazy(() => import("../pages/login/login1"));
const UserIndex = lazy(() => import("../pages/user/index"));
const UserCreate = lazy(() => import("../pages/user/create"));
const Product = lazy(() => import("../pages/product/index"));
const Presale = lazy(() => import("../pages/presale/index"));
const Layout = lazy(() => import("../layout/index"));

interface Props {}
const ReactRouter: FC<Props> = () => {
  return (
    <Router>
      <Routes>
        <Route path="/" element={<Layout />}>
          <Route path="user/index" element={<UserIndex />} />
          <Route path="user/create" element={<UserCreate />} />
          <Route path="product" element={<Product />} />
          <Route path="presale" element={<Presale />} />
        </Route>
        <Route path="/login1" element={<Login1 />} />
      </Routes>
    </Router>
  );
};

export default ReactRouter;
